﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FC_Detail.aspx.cs" Inherits="WAD.WEB.Client2.FC_Detail" %>
<!doctype html>
<html>
<head>
    <title>微街秀 > 分享推广</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
      <link href="plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/css.css" />
    <script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="js/ajax-data.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script src="js/dialog.js" type="text/javascript"></script>
    <script src="js/Makeadvrtdetail.js" type="text/javascript"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
        <script src="js/sha.js" type="text/javascript"></script>
        <script src="js/sign.js" type="text/javascript"></script>
    
    <link href="css/Makeadvrtdetail.css" rel="stylesheet" type="text/css" />
    <%="<meta property=\"og:type\" content=\"article\" />" %>
    <%="<meta property=\"og:url\" content=\""+url+"\" />" %>
    <%="<meta property=\"og:pics\" content=\"" +  logo + "\"/>"%>
    <%= "<meta property=\"og:release_date\" content=\"" + DateTime.Now.ToString() + "\"/>"%>
    <%= "<meta property=\"og:title\" content=\"" + title + "\"/>" %>
    <%= "<meta property=\"og:description\" content=\"" + GetIntro(50) + "\"/>"%>
    <%= "<meta property=\"og:image\" content=\"" +  logo + "\"/>"%>
</head>
<body>
    <div class="wamtop">
        <div class="topleft" onclick="javascript:window.history.go(-1);">
            <img src="img/5.jpg" />
        </div>
        <div class="topcententxt">
            分享推广
        </div>
        <div class="topright" style="display:none">
            
        </div>
    </div>
    <div>
        <div style="width: 95%; margin: 30px auto 0 auto; line-height: 20px;">
            <div class="ifr_body">
                <iframe id="ifmUrl" onload="ifmLoad();" src="<%=url %>"></iframe>
            </div>
        </div>
    </div>
    <div class="RedPack">
        <div class="RedPacktxt">
            <img src="img/Makeimg/13.png" style="width: 100%;">
            <img src="img/Makeimg/20.png" style="width: 50px; position: absolute; top: 10px;
                left: 50%; margin-left: -25px;">
            <div class="Advrt" style="display:none">
                
            </div>
            <div class="getRedPack">
                分享文章，领红包啦！
            </div>
            <div style="background: #DA3932;">
                <div class="RpBoill">
                    红包排行榜
                    <div class="Rpyuan">
                    <div class="Rpli"></div>
                    <div class="Rpli"></div>
                    <div class="Rpli"></div>
                    <div class="Rpli"></div>
                    </div>
                    </div>
                <div class="tg_select">         
                </div>
                <img src="img/Makeimg/14.png" style="width: 100%;" />
            </div>
        </div>
    </div>
    <div style="position: fixed; top: 200px; left: 2.5%; background: #B22C23; width: 95%;
        display: none; height: 140px;">
        <div style="width: 90%; margin: 20px auto 0 auto; height: 100px; border: 1px white solid;">
            <div style="color: white; width: 100%; text-align: center; padding-top: 20px;">
                分享文章后，可以参与抢红包哦！</div>
            <div style="width: 80%; height: 40px; text-align: center; line-height: 40px; background: #FF8901;
                border-radius: 5px; margin: 15px auto 0 auto;">
                分享到朋友圈</div>
        </div>
    </div>


      <div class="backimg-panl buzhou hide">
        <div class="font-content" style="right: -150px;">
            <img src="img/buzhou/2_5.png" style="width: 50%;" />
            <div>
                <p>
                    点这里分享</p>
             
                <button class=" btn btn-color btn-default " onclick="NextBZ(1)">
                    下一步</button></p>
            </div>
        </div>
    </div>
    <div class="backimg-panl buzhou hide">
        <div class="font-content" style="bottom: 0;">
            <div class=" text-center" style="margin-bottom: -70px;">
                <p>
                    分享到朋友圈</p>
                <p>
                    进行截图</p>
                <p>
                    <button class=" btn btn-color btn-default " onclick="UpBZ(1)">
                        上一步</button></p>
                <p>
                    <button class=" btn btn-color btn-default " onclick="NextBZ(2)">
                        下一步</button></p>
                <img src="img/buzhou/2_6.png" class=" pull-left" style="width: 50%;" />
            </div>
        </div>
    </div>
    <div class="backimg-panl buzhou hide">
        <div class="font-content" style="top: 47%;">
            <div class=" text-center" style="position: absolute; left: 28%; top: -41%;">
                <p>
                    将文章分享到</p>
                <p>
                    朋友圈截图</p>
                <p>
                    <button class=" btn btn-color btn-default " onclick="UpBZ(2)">
                        上一步</button></p>
                <p>
                    <button class=" btn btn-color btn-default " onclick="NextBZ(3)">
                        下一步</button></p>
            </div>
            <img src="img/buzhou/2_7.png" />
        </div>
    </div>
    <div class="backimg-panl buzhou hide">
        <div class="font-content" style="top: 47%;">
            <div class=" text-center" style="position: absolute; left: 110px; top: -110px;">
               <p>
                    点击上传</p>
                <p>
                    就完成了</p>
                <p>
                    抢红包的步骤哦</p>
                 <p>
                    <button class=" btn btn-color btn-default " onclick="NextBZ(4)">
                        知道了</button></p>
            </div>
            <img src="img/buzhou/2_8.png" />
        </div>
    </div>

        <div class="backimg-panl buzhou hide" onclick="SetBZ(22)">
        <div class="font-content" style="bottom: 40%;">
            <div class=" text-center" >
                <p>
                    上传完截图后</p>
                <p>
                    自动跳转到分享记录页面</p>
                <p>
                    即可查看红包金额
                </p>
            </div>
            <img src="img/buzhou/2_9.png" />
        </div>
    </div>
    <script>

        ShowBZ(22); //显示引导
        var pagecount = "0";
        var page = 1;
        var money_id = "0";
        var article_id = "0";
        var from_user_id = "<%=authorId %>";
        $(document).ready(function () {
            var param = {};
            AjaxStart("ajax/WxJsApiAccessToken.ashx?get", param, function (data) {
                if (data.code == 0) {
                    var s = sign(data.item.JsApi_Ticket, location.href.split('#')[0]);
                    wx.config({
                        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。    
                        appId: data.item.AppId, // 必填，公众号的唯一标识    
                        timestamp: s.timestamp, // 必填，生成签名的时间戳    
                        nonceStr: s.nonceStr, // 必填，生成签名的随机串    
                        signature: s.signature,// 必填，签名，见附录1    
                        jsApiList: ['onMenuShareTimeline'] //分享朋友圈
                    });
                }
                else
                    Alert(data.msg);
            });
            money_id = getQueryString("money_id");
            article_id = getQueryString("article_id");
            if (money_id != null && money_id != "") {
                $(".topright").css("display", "");  //显示分享
                $(".Advrt").css("display", "");
            }

            load(page);
            
        });
        wx.ready(function() {
             wx.onMenuShareTimeline({
                title:'<%=title%>',
                link:'<%=url%>',
                imgUrl:'<%=logo%>',
                complete:function(){
                    //Alert("接口调用完成");
                    //sharedCallback();
                },
                success: function () {
                    //Alert("接口调用完成");
                     sharedCallback();
                 }
             });
        });
        function load(page) {
            if (pagecount == "1") { return; }
            if (!islogin()) { window.location.href = 'login.html'; return; }
            AjaxStart("ajax/fc_shared.ashx?getHongBao", "article_id=" + getQueryString("article_id") + "&page_index=" + page, function (data) {
                if (data.code == "4")
                    $(".tg_select").html("<div style='padding-top: 30px;color:#fff;text-align: center;'>您是第一个分享的，赶紧分享领取红包吧！</div>")
                loadhtml(data);
                
            });
        }

        function loadhtml(data) {
            var i = 1;
            
            $(data.item.table).each(function () {
                var logo = this.user_logo == null ? "img/cover.jpg" : this.user_logo;
                $(".tg_select").append("<div style=\"border-bottom: #B82D26 1px solid; height: 60px; width: 100%;\">" +
                    "<div class=\"RpRedpackimg\"><img src='img/makeimg/15.png' style=\"width: 20px;\"><span class=\"RpNumber\">" + i + "</span></div>" +
                    "<img src='" + logo + "' class=\"Rptopimg\"><div class=\"RpLian\">" +
                        "<span style=\"font-size: 14px;white-space: nowrap;\">" + this.nick_name + "</span><br>" +
                        "<span style=\"font-size: 12px;\">" + this.date.replace("T", " ").substring(0, 19) + "</span></div>" +
                    "<span class=\"Rpmoney\">￥" + this.price + "</span></div>");

                i++;
            });
        }

        function sharedCallback() {
            var param = "platform=1&article_id=" + article_id + "&from_user_id=" + from_user_id + "&money_id=" + money_id;
            AjaxStart("ajax/fc_shared.ashx?insert", param, function (data) {
                if (data.code == 0) {
                    var id = data.item;
                    Alert("分享成功,请上传截图");
                    window.location.href = "makeshareupload.html?id=" + id + "&money_id=" + money_id + "&article_id=" + article_id;
                }
                else
                    Alert(data.msg);
            });
        }
    </script>
    <script src='js/weixinShare.js'></script>
</body>
</html>
